﻿using System.Collections.Generic;

namespace ValidationFramework.Tests.Performance.TestHelpers
{
	/// <summary>
	/// A performance neutral IValidationPolicy implementation
	/// </summary>
	public class FakeValidationPolicy : IValidationPolicy
	{
		private readonly string _MemberName;
		private readonly List<ValidationError> _ValidateErrors;
		private readonly List<ValidationError> _ValidateNoParentErrors;

		/// <summary>
		/// Initializes a new instance of the FakeValidationPolicy class.
		/// </summary>
		/// <param name="memberName"></param>
		/// <param name="validateErrors"></param>
		/// <param name="validateNoParentErrors"></param>
		public FakeValidationPolicy(string memberName, List<ValidationError> validateErrors, List<ValidationError> validateNoParentErrors)
		{
			_MemberName = memberName;
			_ValidateErrors = validateErrors;
			_ValidateNoParentErrors = validateNoParentErrors;
		}
		#region IValidationPolicy Members

		public string MemberName
		{
            get { return _MemberName; }
		}

		public List<ValidationError> Validate(object parentValue, ValidationOptions options)
		{
            return _ValidateErrors;
		}

		public List<ValidationError> ValidateNoParent(object memberValue, ValidationOptions options)
		{
			return _ValidateNoParentErrors;
		}

		#endregion

		#region IValidationPolicy Members


		public ValidationFramework.RuleCollection ParentScopeRules
		{
			get { throw new System.NotImplementedException(); }
		}

		public ValidationFramework.RuleCollection MemberScopeRules
		{
			get { throw new System.NotImplementedException(); }
		}

		public int RuleCount
		{
			get { throw new System.NotImplementedException(); }
		}

		public Rule AddRule(Rule rule, RuleScope scope)
		{
			throw new System.NotImplementedException();
		}

		public void Lock()
		{
			throw new System.NotImplementedException();
		}

		public void UnLock()
		{
			throw new System.NotImplementedException();
		}

		#endregion
	}
}
